package com.skjanyou.applicationcase.controller;

import java.util.List;

import com.skjanyou.annotation.api.Web.ResponseBody;
import com.skjanyou.annotation.api.enumclass.ResponseType;
import com.skjanyou.applicationcase.bean.Shortcut;
import com.skjanyou.applicationcase.util.WindowsUtil;
import com.skjanyou.mvc.anno.Mvc.Controller;
import com.skjanyou.mvc.anno.Mvc.HttpParameter;
import com.skjanyou.mvc.anno.Mvc.Mapping;


@Controller("window")
public class WindowController {
	
	@Mapping("shortcut")
	@ResponseBody( type = ResponseType.JSON )
	public List<Shortcut> getShortcut(){
		return WindowsUtil.getAllShortCut();
	}
	
	@Mapping("openshortcut")
	@ResponseBody( type = ResponseType.JSON )
	public void openShortcut( @HttpParameter("shortcut") String shortcut ){
		WindowsUtil.executeExeableFileByCopyNewFile(shortcut);
	}	
	
}
